package com.codedef.library.entity;


import com.codedef.library.common.valid.AddGroup;
import com.codedef.library.common.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity(name = "task")
public class Task {

    //任务id
    @Id  //标记主键
    @GeneratedValue(strategy = GenerationType.IDENTITY)  //设置自增长策略
    private Integer id;

    //任务类型 0-不启用 1-单次 2-每日  3-每周  4-每月
    private Integer type;

    //重复周期  英文逗号分隔xw
    private String repeatInfo;

    //预约的日期  仅单次预约时生效 仅使用日期部分 2020-09-12
    private String date;

    //开始时间 仅有时间 08:30
    @NotBlank(message = "开始时间必须填写", groups = {AddGroup.class, UpdateGroup.class})
    private String starTime;

    //结束时间 仅有时间 22:30
    @NotBlank(message = "结束时间必须填写", groups = {AddGroup.class, UpdateGroup.class})
    private String endTime;

    //学号列表  英文逗号分隔
    @NotBlank(message = "用户名列表必须填写", groups = {AddGroup.class, UpdateGroup.class})
    private String usernames;

    //密码列表  英文逗号分隔
    @NotBlank(message = "密码列表必须填写", groups = {AddGroup.class, UpdateGroup.class})
    private String passwords;

    //候选座位号列表  英文逗号分隔
    @NotBlank(message = "座位列表必须填写", groups = {AddGroup.class, UpdateGroup.class})
    private String seatNums;

    //排序
    private Integer weight;

    //接收消息的邮箱  英文逗号分隔
    @NotBlank(message = "邮箱列表必须填写", groups = {AddGroup.class, UpdateGroup.class})
    private String emails;


}
